import request from "@/api/utils/request.js";

const BASE_URL = "/chatRoom";

export default {

  initAfter: (chatRoomId) => {
    return request({
      url: `${BASE_URL}/initAfter/${chatRoomId}`,
      method: 'GET'
    })
  },

  getChatRoomInfo: (chatRoomId) => {
    return request({
      url: `${BASE_URL}/getChatRoomInfo/${chatRoomId}`,
      method: 'GET',
    })
  },

  pageMessageByChatRoomId: (req) => {
    return request({
      url: `${BASE_URL}/pageMessageByChatRoomId`,
      method: 'POST',
      data: req
    })
  },

  execBeforeMessagePublishToChatRoom: (req) => {
    return request({
      url: `${BASE_URL}/execBeforeMessagePublishToChatRoom`,
      method: 'POST',
      data: req
    })
  },

  saveMessageToChatRoom: (req) => {
    return request({
      url: `${BASE_URL}/saveMessageToChatRoom`,
      method: 'POST',
      data: req
    })
  },

  getOnlineList: (chatRoomId) => {
    return request({
      url: `${BASE_URL}/listOnline/${chatRoomId}`,
      method: 'GET'
    })
  }

}